package com.hzit.loan.pay.commonApi.resp;

import lombok.Data;
import lombok.ToString;

/**
 * 通用返回对象
 */
@Data
@ToString
public class RespVo<T> {


    private int  code; //返回码 0：成功，-1：失败

    private String msg; //返回描述

    private T data;

    /**
     * 通用错误返回
     * @param errMsg
     * @return
     */
    public static RespVo getFailReturn(String errMsg){

        RespVo respVo = new RespVo();

        respVo.setCode(-1);
        respVo.setMsg(errMsg);

        return respVo;
    }


}
